package web;

import java.util.List;

import vo.Employee;
import vo.Source;
import business.EmployeeService;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.Preparable;

@SuppressWarnings("unchecked")
public class EmployeeAction implements Preparable {
	private EmployeeService service;
	private List<Employee> employees;

		public String execute() {
		this.employees = service.getAllEmployees();
		return Action.SUCCESS;
	}

	public String add() {
		service.addEmployee("hello xxx");
		return execute();
	}

	public List<Employee> getEmployees() {
		return employees;
	}

	public void prepare() throws Exception {
		// if (id != null)
		// employee = service.find(id);
	}

	public void setEmployeeService(EmployeeService service) {
		this.service = service;
	}

}